/**
 * 
 */
package ar.com.greensoft.neosystem.crm.web.beans;

import javax.ejb.EJB;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.faces.convert.Converter;
import javax.inject.Named;

import ar.com.greensoft.jeecommons.web.jsf.converters.LongIdConverter;
import ar.com.greensoft.neosystem.dao.PaisDao;
import ar.com.greensoft.neosystem.dao.PersonaFisicaDao;
import ar.com.greensoft.neosystem.dao.ProvinciaDao;
import ar.com.greensoft.neosystem.model.PersonaFisica;
import ar.com.greensoft.neosystem.model.address.Pais;
import ar.com.greensoft.neosystem.model.address.Provincia;

/**
 * 
 * @author Jorge E. Villaverde
 * @date 09/01/2012
 * @version 1.0.0
 */
@ApplicationScoped
public class ConvertersBean {
	@EJB
	private PersonaFisicaDao personaFisicaDao;
	@EJB
	private ProvinciaDao provinciaDao;
	@EJB
	private PaisDao paisDao;
	
	@Produces
	@Named
	public Converter getProvinciaConverter(){
		return new LongIdConverter<Provincia>(provinciaDao);
	}

	@Produces
	@Named
	public Converter getPaisConverter(){
		return new LongIdConverter<Pais>(paisDao);
	}

	@Produces
	@Named
	public Converter getPersonaFisicaConverter(){
		return new LongIdConverter<PersonaFisica>(personaFisicaDao);
	}
}
